<?php

// $Id$

require_once('../../boot.inc.php');
boot('tcms');

global $WSC;

require_once($WSC->get_site_inc_dir().'modules/tangra_cms/_sys/tcms_request_handler.class.php');
require_once(TANGRA_MAIN_DIR.'db/db_config.class.php');
require_once(TANGRA_MAIN_DIR.'db/db_config_loader_file.class.php');


global $_SITE_DBC;
if (!($_SITE_DBC instanceof DB_Connection)) {
	$db_config_loader = new DB_Config_Loader_File($PATHS->get_hidden().'conf/db.conf');
	$db_config = new DB_Config();
	$db_config_loader->load_db_config($db_config);
//TODO - to use _SITE_DBC_PNT - have to check all subsequent classes to check if they really need transactions
	$_SITE_DBC = new Site_DBC($db_config);
}
$dbc = $_SITE_DBC;

session_start();

$context = new Web_Context();

$request_handler = new TCMS_Request_Handler($WSC, $dbc, $context);
$request_handler->handle_request();


